<script type="text/javascript">
$(function(){
	$.post("roleManage/getInfoByRole",getInfoByRole,"json");
}); 

//人员设置
function personnelSet(event){
	var stra=$(event).parent().parent().parent().find("td:eq(1)").text();
	var parm=stra;
	var options={"width":"600","height":"400","parm":parm};
	$.pdialog.open("roleManage/goPersonnelSet","infos", "人员设置",options);
}
//功能授权
function accredit(event){
	var stra=$(event).parent().parent().parent().find("td:eq(1)").text();
	var parm=stra;
	//alert(stra)
	var options={"width":"600","height":"500","parm":parm};
	$.pdialog.open("roleManage/functionAccredit","infos", "功能授权",options);
}
//删除角色
function deleteRole(){
	 if($("input[name='roleManage']:checked").length < 1){
		 alertMsg.warn("您未选择数据！")
		 return false;
	 }
	var roles=new Array();
	$("input[name='roleManage']:checked").each(function(n,item){
		var role=$(this).val();
		roles.push(role);
	})
	$.ajax({
		type: 'POST',
		url:"roleManage/deleteRole",
		dataType:"json",
		data:{
			"roles":roles
		},
		cache: false,
		traditional:true,
		success: navTabAjaxDone,//回调函数
		error: DWZ.ajaxError
	});
}
</script>

<form id="pagerForm" method="post" action="roleManage/getInfoByRole"
	class="pageForm required-validate"
	onsubmit="return validateCallback(this,getInfoByRole);">
	<input type="hidden" name="pageNum" value="" /> <input type="hidden"
		name="numPerPage" value="" />
	<!-- <input type="hidden" name="pageCount" value="" /> -->
	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
				<li><a class="add" href="roleManage/addRole" target="dialog"
					rel="addRole" width="500" height="240" title="添加角色"><span>新增</span></a></li>
				<li><a class="delete" onclick="return deleteRole();"><span>删除</span></a></li>
			</ul>
		</div>
		<div id="ByRoleManage">
			<table class="table" width="100%" layoutH="258">
				<thead>
					<tr align="center">
						<th width="2%"><input type="checkbox" name=""
							group="roleManage" class="checkboxCtrl"></th>
						<th width="10%" orderField="accountLevel">角色ID</th>
						<th width="15%">角色编号</th>
						<th width="15%">角色名称</th>
						<th width="20%">描述</th>
						<th width="15%">所有者</th>
						<th width="23%">操作</th>
					</tr>
				</thead>
				<tbody id="tbodyByRole">

				</tbody>
			</table>
		</div>
		<!--  <div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select id="numPerPageByRole" name="numPerPage" onchange="paging(this,$('#getInfoByRole'),getInfoByRole)">
				<option value="20">20</option>
				<option value="30">30</option>
				<option value="50">50</option>
				<option value="100">100</option>
			</select>
			<span id="totalCountByRole" ></span>
		</div>
			<div id="paginationByRole" class="pagination1"  ></div>
	</div> -->
		<div class="panelBar">
			<div class="pages">
				<span>显示</span> <select class="combox" name="numPerPage"
					onchange="navTabPageBreak({numPerPage:this.value},'tbodyByRole',getInfoByRole)">
					<option value="20">20</option>
					<option value="50">50</option>
					<option value="100">100</option>
					<option value="200">200</option>
				</select> <span id="totalCountByRole">条，共${totalCount}条</span>
			</div>

			<div callback='getInfoByRole' id="paginationByRole" rel="tbodyByRole"
				class="pagination" targetType="navTab" totalCount="200"
				numPerPage="5" pageNumShown="5" currentPage="1"></div>

		</div>
	</div>
</form>
